import {
  GET_customMenus,
  GET_indexMenu,
  SET_menuCodeMenuLeafs
} from './type'
import {
  queryCustomMenus,
  queryMenus
} from '../../api/menus';

export default {
  [GET_customMenus]({commit}){
    queryCustomMenus().then((res)=> {
      commit(GET_customMenus,res);
    })
  },
  [GET_indexMenu]({commit}){
    queryMenus().then((res)=>{
      commit(GET_indexMenu,res)
    })
  },
  [SET_menuCodeMenuLeafs]({commit},r){
    commit(SET_menuCodeMenuLeafs,r)
  }
}
